<template>
	<view class="all_store" :class="themeName">
		<view class="store-container">
			<view v-for="(item, index) in lists" :key="index" class="store-item m-b-20">
				<view class="flex row-between">
					<image class="img" :src="item.shop.image" mode=""></image>
					<view class="s-boxs">
						<view class="header-title back md">{{ item.title }}</view>
						<view class="sm lighter">所属门店：{{ item.shop.name }}</view>
						<view class="sm lighter">门店店长：{{ item.shop.contact }}</view>
						<view class="sm lighter">店址：{{ item.shop.address }}</view>
						<view class="sm" style="color: red;">注:立即下单可帮用户开启设备</view>
					</view>
					<view>
						<!-- <view @click="upstu(item.id)" class="s-go sm s-go2 m-l-20">修改状态</view>
						<view v-if="item.is_open==0" @click="setpay(item.id)" class="s-go sm s-go3 m-l-20 m-t-30">立即下单</view> -->
						<view @click="setpay(item.id)" class="s-go sm s-go3 m-l-20 m-t-30">立即下单</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { shopjiqiren,updateopen } from '@/api/others.js';
export default {
	name: 'AllStore',
	data() {
		return {
			lists: [
				// {id:'aa',status:1},
				// {id:'bb',status:2}
			]
		};
	},
	async onLoad() {
		await this.getList();
	},
	methods: {
		// 机器人列表
		getList() {
			shopjiqiren().then((res) => {
				this.lists = res;
			});
		},
		upstu(id){
			updateopen({id:id}).then((res) => {
				this.getList();
			});
		},
		setpay(id){
			uni.navigateTo({
				url:'/others/pages/manager/myjqrpay?id='+id
			})
		}
	},

	created() {}
};
</script>
<style lang="scss">
.search-container {
	display: flex;
	flex-direction: column;
}
.search-input {
	display: flex;
	align-items: center;
	height: 100rpx;
	padding: 0 20rpx;
	background-color: #ffffff;
	position: relative;
	z-index: 2;
}
.store-container {
	position: relative;
	z-index: 1;
	background-color: white;

	.store-item {
		padding: 20rpx 30rpx;
		border-radius: 10rpx;

		.img {
			width: 130rpx;
			height: 130rpx;
			border-radius: 50%;
			margin-right: 20rpx;
		}
		.s-boxs {
			flex: 1;
			line-height: 36rpx;

			.line-2 {
				-webkit-line-clamp: 1;
			}
		}
		.s-go {
			white-space: nowrap;
			color: #0980cc;
			font-size: 28rpx;
			padding: 5rpx 15rpx;
			text-align: center;
		}
		.s-go2 {
			background-color: #10b9c4;
			border-radius: 35rpx;
			color: #fff;
		}
		.s-go3 {
			background-color: #0980cc;
			border-radius: 35rpx;
			color: #fff;
		}
	}
}
</style>
